<div class="wide form">
<?php $form = $this
	->beginWidget('CActiveForm',
		array(
			'id' => 'user-form',
			'enableAjaxValidation' => false,
		));
?>

	<p class="note">带 <span class="required">*</span> 的是必填的哦！</p>

	<?php echo $form->errorSummary($model); ?>

<?php if ($model->getIsNewRecord()) { ?>
	<div class="row">
		<?php echo $form->labelEx($model, 'username'); ?>
     		<?php echo $form
					 ->textField($model, 'username',
						 array(
							 'size' => 60,
							 'maxlength' => 255
						 ));
			 ?>
     		<?php echo $form->error($model, 'username'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model, 'password'); ?>
     		<?php echo $form
					 ->textField($model, 'password',
						 array(
							 'size' => 60,
							 'maxlength' => 255
						 ));
			 ?>
     		<?php echo $form->error($model, 'password'); ?>
	</div>
<?php } else { ?>
	<div class="row">
		<?php echo $form->labelEx($model, 'username'); ?>
     		<?php echo $model->username;
			 ?>
	</div>
		<div class="row">
		<?php echo $form->labelEx($model, 'password'); ?>
     		<?php
				 $model->password = '';
				 echo $form
					 ->textField($model, 'password',
						 array(
							 'size' => 60,
							 'maxlength' => 255
						 ));
			 ?>
     		<?php echo $form->error($model, 'password'); ?>
     	<div class="hint">留空则不改变密码</div>
	</div>
<?php } ?>
	<div class="row">
		<?php echo $form->labelEx($model, 'active'); ?>
     		<?php echo $form->checkBox($model, 'active'); ?>
     		<?php echo $form->error($model, 'active'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '创建' : '保存'); ?>
	</div>
<?php $this->endWidget(); ?>

</div><!-- form -->
